package com.blue.test;

import java.util.List;

import com.jfinal.core.ActionKey;
import com.jfinal.core.Controller;

public class Hello extends Controller {
	
	@ActionKey(value="getNewsHead")
	
	public void index() {
		int newsHead = (int)(Math.random()*2 +1);
		if (newsHead == 1) {
			newsHead = 2;
			List<NewsImportant> list = NewsImportant.dao
					.find("select * from newsimportant where type = 1");
			renderJson("list", list);
		} else if (newsHead == 2) {
			newsHead = 1;
			List<NewsImportant> list = NewsImportant.dao
					.find("select * from newsimportant where type = 2");
			renderJson("list", list);

		}
	}
}